-
Notifications
You must be signed in to change notification settings - Fork 248
Resolve build failures so repository will build with ./gradlew clean build
#584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This disables several checks to make the build succeed. We should try to enable the checks and fix the underlying issues. - Adds missing BLUETOOTH_CONNECT and BLUETOOTH_SCAN permissions to AndroidManifest.xml for BluetoothLe sample. - Adds ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION to AndroidManifest.xml and uses tools:ignore to suppress the CoarseFineLocation warning. - Adds `@SuppressWarnings("MissingPermission")` annotations to setUpBLE methods in MainActivity.java and MainActivity.kt, and scanLeDevice method in DeviceScanActivity.kt to suppress lint warnings. - Increases Xmx value to 4g in gradle.properties. - Disables lint checks during release builds in gradle.properties. - Sets an icon to the Credential Provider in identity/credentialmanager/src/main/AndroidManifest.xml.
- @SuppressWarnings("MissingPermission") + @RequiresPermission(Manifest.permission.BLUETOOTH_CONNECT)
- Add `./gradlew build` to build all modules used by the root project - Add --stacktrace to gradlew commands in build.yml - Update Kotlin jvmToolchain in xr/build.gradle.kts to 17
I could not reproduce this failure https://github.com/android/snippets/actions/runs/16839790873/job/47708049483. I added --stacktrace to the build workflow to understand why it is failing. |
We could probably simplify the build script. Our previous GitHub Actions workflow was missing some modules, so we could choose to run
|
Nice! Let's change the build script in this PR as well and see if it passes |
.github/workflows/build.yml
Outdated
run: ./gradlew :compose:snippets:build --stacktrace | ||
- name: Build recompose snippets | ||
run: ./gradlew :compose:recomposehighlighter:build | ||
run: ./gradlew :compose:recomposehighlighter:build --stacktrace | ||
- name: Build kotlin snippets | ||
run: ./gradlew :kotlin:build | ||
run: ./gradlew :kotlin:build --stacktrace | ||
- name: Build Wear snippets | ||
run: ./gradlew :wear:build | ||
run: ./gradlew :wear:build --stacktrace | ||
- name: Build misc snippets | ||
run: ./gradlew :misc:build | ||
run: ./gradlew :misc:build --stacktrace | ||
- name: Build XR snippets | ||
run: ./gradlew :xr:build | ||
run: ./gradlew :xr:build --stacktrace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably remove this if the build is running again at the end
The following are redundant because they will run during `./gradlew build --stacktrace` - name: Build Compose run: ./gradlew :compose:snippets:build --stacktrace - name: Build recompose snippets run: ./gradlew :compose:recomposehighlighter:build --stacktrace - name: Build kotlin snippets run: ./gradlew :kotlin:build --stacktrace - name: Build Wear snippets run: ./gradlew :wear:build --stacktrace - name: Build misc snippets run: ./gradlew :misc:build --stacktrace - name: Build XR snippets run: ./gradlew :xr:build --stacktrace
@riggaroo @bentrengrove I simplified the build script to |
Key changes include:
bluetoothle
sample.bluetoothle
manifest to comply with Android 12+ requirements for apps requesting ACCESS_FINE_LOCATION.identity/credentialmanager
manifest that was causing a build error.bluetoothle
manifest.